<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page contentType="text/html;charset=utf-8" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Admin Template </title>
<%@ include file="include.jsp"%>

<script type="text/javascript">
$(document).ready(function(){
	
	/* setup navigation, content boxes, etc... */
	Administry.setup();
	
	/* datatable */
	$('#example').dataTable();
	
	$("#add").click(function() {
		//alert('aa');
  		$('#thickboxId').click();
  	});

});
	
</script>




</head>
<body>


	<%@ include file="header.jsp"%>
	<!-- Page content -->
	<div id="page">
		<!-- Wrapper -->
		<div class="wrapper">
				<!-- Left column/section -->
				<section class="column width6 first">					
					

					
					<div class="clear">&nbsp;</div>
					
					<h3>Vote tables</h3>
<!--					<a href="#" class="btn" id="cm"><span class="icon icon-add">&nbsp;</span>Add New</a>-->
					<input name="add" id="add" type="button" class="btn" value="Add New" />
					
<!--					<a href="#ap" class="nyroModal">Inline content</a><br />-->
					<a id="thickboxId" a href="#av"  class="nyroModal" title=""></a>
					<div id='av' style='display: none;'><%@ include file="addvote.jsp"%></div>
					
					<table class="display stylized" id="example">
						<thead>
							<tr>
								<th>ID</th>
								<th>User_ID</th>
								<th>VoteTitle</th>
								<th>agree</th>
								<th>neutrally</th>
								<th>disagree</th>
								<th>start_time</th>
								<th>end_time</th>
								<th>operate</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach items="${votes}" var="vote">
	
								<tr>
									
									<td>
										<c:out value="${vote.id}" />
									</td>
									
									<td>
										<c:out value="${vote.user_id}" />
									</td>
									
									
									<td> 
										<c:out value="${vote.vote_title}" />
									</td>
									
									
									<td>
										<c:out value="${vote.agree}" />
									</td>
									
									
									<td>
										<c:out value="${vote.neutrally}" />
									</td>
									
									
									<td>
										<c:out value="${vote.disagree}" />
									</td>
									
									
									<td>
										<c:out value="${vote.start_time}" />
									</td>
									
									<td>
										<c:out value="${vote.end_time}" />
									</td>
									
									<td>
										<input type="checkbox" name="checkbox" value="${vote.id}" />
									</td>
								
	
								</tr>
							</c:forEach>
						</tbody>

				</table>
					
					<div class="clear">&nbsp;</div>
					
				</section>
				<!-- End of Left column/section -->
				
			
				
				
				
		</div>
		<!-- End of Wrapper -->
	</div>
	<!-- End of Page content -->
	
	<%@ include file="footer.jsp"%>

</body>
</html>
